//
//  TMGEarningsTableViewCell.m
//  TMGold
//
//  Created by Mac on 2018/3/19.
//  Copyright © 2018年 tangmu. All rights reserved.
//

#import "TMGEarningsTableViewCell.h"

@interface  TMGEarningsTableViewCell()
@property(nonatomic, strong) STLabel                     *nameLable;
@property(nonatomic, strong) STLabel                     *timeLable;
@property(nonatomic, strong) STLabel                     *moneyLable;
@end
@implementation TMGEarningsTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 60;
}
#pragma mark --subView
- (void)configSubView{
    self.nameLable= [[STLabel alloc] initWithFrame:CGRectMake(15, 0, UIScreenWidth/2, [TMGEarningsTableViewCell cellHeight]/2)
                                                     text:@""
                                                textColor:FirstTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.nameLable];
    
    self.timeLable= [[STLabel alloc] initWithFrame:CGRectMake(15, [TMGEarningsTableViewCell cellHeight]/2, UIScreenWidth/2, [TMGEarningsTableViewCell cellHeight]/2)
                                              text:@""
                                         textColor:SecendTextColor
                                              font:15
                                       isSizetoFit:NO
                                     textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.timeLable];
    
    
    self.moneyLable= [[STLabel alloc] initWithFrame:CGRectMake(15, 0, UIScreenWidth/2, [TMGEarningsTableViewCell cellHeight])
                                              text:@""
                                         textColor:TM_orangeColor
                                              font:15
                                       isSizetoFit:NO
                                     textAlignment:NSTextAlignmentRight];
    self.moneyLable.right = UIScreenWidth - 15;
    [self addSubview:self.moneyLable];
}
- (void)setModel:(TMGEarningModel *)model{
    _model = model;
    self.nameLable.text = model.name;
    self.timeLable.text = model.today;
    self.moneyLable.text = model.money;
}
@end
